package com.itheima.com;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;

public class UDPSend {
    public static void main(String[] args) throws Exception {

        DatagramSocket ds = new DatagramSocket();
        String s ="你好，小姐很高兴认识你";
        byte[] bytes = s.getBytes();
        DatagramPacket dp = new DatagramPacket(bytes,bytes.length, InetAddress.getByName("127.0.0.1"),22400);
        ds.send(dp);
        ds.close();
    }
}
